﻿<?xml version="1.0" encoding="utf-8" ?>
<DbDataRequest connection="$UserLoginDBConnection$" type="$UserLoginDbType$" defaultFormatter="bizobj UserLogin(user)">
  <SqlStatement hasResults="true">
    SELECT
    ul.sessionId, ul.anonUser, ul.loginTime, ul.lastAccessTime, u.id as userid,u.id as usersId, u.username as userusername
    FROM
    UserLogins ul
    LEFT JOIN
    Users u ON u.id = ul.userId
    WHERE
    ul.loginTime Between @firstDate and @lastDate
    ORDER BY
    ul.loginTime,u.id
  </SqlStatement>
  <Param name="firstDate" type="DateTime"/>
  <Param name="lastDate" type="DateTime"/>
</DbDataRequest>